<?php


namespace app\api\controller\v1;


use app\api\controller\BaseController;
use app\api\model\Banner as BannerModel;
use app\api\model\BannerItem;


class Banner extends BaseController
{
    protected $beforeActionList = [
        'checkExclusiveScope' => ['only' => 'getDataList']
    ];

    // 获取banner列表
    public function getDataList($id)
    {
        return BannerModel::where('id',$id)->with('items.img')->find();
    }

    // 获取banner详情
    public function getDataInfo($id)
    {
        return BannerItem::where('id',$id)->find();
    }
}